package test;

import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

public class Test20210325 {
    public static void main(String[] args) throws Exception {
        int input = 27;
        String output = letterConcertFigure(input);
        System.out.println(output);
    }


    public static String letterConcertFigure(int input) throws Exception {
        String finalComPose= "";
        while (input != 0) {
            if (input >= 1000) {input-=1000;finalComPose+="M";}
            else if (input >= 500) {input-=500;finalComPose+="D";}
            else if (input >= 100) {input-=100;finalComPose+="C";}
            else if (input >= 50) {input-=50;finalComPose+="L";}
            else if (input >= 10) {input-=10;finalComPose+="X";}
            else if (input >= 5) {input-=5;finalComPose+="V";}
            else if (input >= 1) {input-=1;finalComPose+="I";}
            else throw new Exception("no this arguement");
        }
return finalComPose;
    }
}
